<template>
<div id="box">
    <div class="left" v-for="pubulius in pubuliu" :key="pubulius.id">
        <img :src="pubulius.goodsImg" @click="tiaozhuan">
        <div class="left-1">{{pubulius.goodsName}}</div>
        <div class="left-1">【三种风味任你选】</div>
        <div class="left-2">
            <div class="cup21">￥{{pubulius.goodsLowPrice}}</div>
            
        </div><br>
        <div class="left-3">赠品</div>
        <p>已售卖9200+件</p>
        <div class="left-4"><span class="iconfont icon-gouwuche1"></span></div>
    </div>
    
    <div id="back"><span class="iconfont icon-xiangshang"></span></div>
</div>
</template>
<script>
import axios from "axios";
export default {
    data(){
        return {
            pubuliu:[]
        }
    },
    methods:{
        tiaozhuan(goodid){
            this.$router.push("/Goods2/"+goodid)
        }
    },
    created(){
        axios({
            url:"/api/goods/findGoodsByType/",
            params:{
                typeId:9
            }
        })
        .then(res=>{
                this.pubuliu=res.data.data
            })
    },

    mounted(){
        var oBack =document.getElementById('back')
        window.onscroll=function(){
        var oTop =document.body.scrollTop ||document.documentElement.scrollTop;
        if (oTop>=1000){
            oBack.style.display = "block"
        }else{
            oBack.style.display = 'none'
        }
    }
    }
}
</script>
<style scoped>
@import url("../assets/font_2735397_jcfueec7nca/iconfont.css");
#box{
    column-count: 2;
    column-gap: 10px;
    width: 3.4rem;
}
.box1{
    width: 1.65rem;
    float: left;
}
.box2{
    width: 1.65rem;
    float: right;
    margin-right: 0.2rem;
}
.left{
    margin-left: 0.1rem;
    width: 1.65rem;
    /* height: 3.69rem; */
    margin-top: 0.1rem;
    background-color: #fff;
    float: left;
}
.left-1{
    font-size: 0.11rem;
    margin-left: 0.09rem;
}
.left-2{
    margin-top: 0.1rem;
    margin-left: 0.09rem;
}

.left-3{
    width: 0.22rem;
    height: 0.12rem;
    font-size: 0.08rem;
    line-height: 0.12rem;
    color: #ed9878;
    background-color: #fce4db;
    margin-bottom: 0.08rem;
    margin-left: 0.09rem;
}
p{
    display: block;
    width: 1rem;
    float: left;
    font-size: 0.1rem;
    color: #878787;
    margin-left: 0.09rem;
}
.left-4{
    width: 0.18rem;
    height: 0.18rem;
    float: right;
    border-radius: 50%;
    background-color: #e63900;
    font-size: 0.1rem;
    color: #fff;
    line-height: 0.18rem;
    margin-right: 0.05rem;
}
.right{
    margin-left: 0.1rem;
    width: 1.65rem;
    /* height: 3.4rem; */
    margin-top: 0.1rem;
    background-color: #fff;
    float: left;
    border-radius: 0.04rem;
}
.right-1{
    height: 0.28rem;
    font-size: 0.11rem;
    margin-left: 0.16rem;
    text-overflow: ellipsis;
    overflow: hidden;
}
.right-2{
    margin-top: 0.1rem;
    margin-left: 0.09rem;
}
.right-3{
    width: 0.22rem;
    height: 0.12rem;
    font-size: 0.08rem;
    line-height: 0.12rem;
    color: #ed9878;
    background-color: #fce4db;
    margin-bottom: 0.08rem;
    margin-left: 0.09rem;
}
.right-4{
    width: 0.18rem;
    height: 0.18rem;
    float: right;
    border-radius: 50%;
    background-color: #e63900;
    font-size: 0.1rem;
    color: #fff;
    line-height: 0.18rem;
    margin-right: 0.05rem;
}
img{
    border-top-left-radius: 0.05rem;
    border-top-right-radius: 0.05rem;
}
#back{
    width: 0.3rem;
    height: 0.3rem;
    float: right;
    border-radius: 50%;
    background-color: white;
    font-size: 0.1rem;
    color: #737373;
    line-height: 0.3rem;
    text-align: center;
    margin-right: 0.05rem;
    position: fixed;
    right: 0.10rem;
    bottom: 1.80rem;
    z-index: 99; 
}
</style>